package teste;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.GregorianCalendar;

import model.Administrador;
import model.Aluno;
import model.Curso;
import model.DAOAdministrador;
import model.DAOAluno;
import model.DAOCurso;
import model.DAOProfessor;
import model.DAOTurma;
import model.Professor;
import model.Turma;
import model.Turno;

public class App {
	public static void main(String[] args){
		DAOAdministrador daoAdm = new DAOAdministrador();
		daoAdm.begin();
		Administrador adm = new Administrador();
		adm.setLogin("admin");
		String senha ="123";
		MessageDigest md=null;
		try {
			md = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		BigInteger hash = new BigInteger(1, md.digest(senha.getBytes()));  
		String s2 = hash.toString(16);  
		adm.setSenha(s2);
		adm.setNome("Administrador");
		daoAdm.persist(adm);
		daoAdm.commit();
		
	}
}
